<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>标题</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width,minimum-scale=0.5,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />

	<script src="./js/zepto.js"></script>
	<script src="./js/rem.js"></script>
	<script src="./js/touch.min.js"></script>
	<script src="./js/laytpl.js"></script>
	<link rel="stylesheet" href="./css/about.css" />
	<style>
		body{
			background: #f0f0f0;
		}
		section .main .shop-mess .show-content-list li{
			line-height: 0.75rem;
			border-top: 1px solid #e3e3e3;
			border-bottom:none;
		}
	</style>
</head>
<body>
	<section id="goodswrapper">
		
	</section>
	<script type="text/html" id="goodscontent">
		<div class="main">
			
			<div class="shop-mess">
				<div class="shop-serve">
					<ul class="show-content-list">
						{{# for(var i=0,arr=d;i<d.length;i++){ }}
							<li style="cursor:pointer" data-id="{{d[i].id}}">{{d[i].title}}</li>
						{{# } }}
					</ul>
				</div>
				<!--
				<div class="shop-detail-mess">
					<ul class="show-content-list">
						{{# for(var i=0,arr=d;i<d.length;i++){ }}
							<li>{{d[i].title}}</li>
						{{# } }}
						
					</ul>
				</div>

				-->
				
			</div>
		</div>
	</script>
</body>
<script>
	function formatTemplate(dta, tmpl) {  
        var b;
        var format = { 
            price: function(x) {  
                // console.log(typeof x,this.discount);
                return (x*b).toFixed(2); 
            },
            discount:function(a){
                b=a==0?1:a*0.1;
                return b;
            }
        };  
        return tmpl.replace(/{(\w+)}/g, function(m1, m2) {  
            if (!m2)  
                return "";  
            return (format && format[m2]) ? format[m2](dta[m2]) : dta[m2];  
        });  
    }
	function request(method,url,fun,data){
    	// console.log(url);
        data=data||{};
        url+="?v="+new Date().getTime();
    	$.ajax({
    		type:method,
		   	url:url,
		   	data:data||{date:new Date().getTime()},
		   	success: function(msg){
				if(fun){
                    fun(msg);
                    }  		 	
		   },
       error:function(e){
         console.log(JSON.stringify(e));
        
            }
        })
		
    }

    var arr=location.href.split('?');

    var id=arr?arr[1].split('=')[1]:0;
    // var id=19

    request('get','/api/article/list',function(data){
    	console.log(data)
    	if(data.code==200){
    		var goodso=data.data.cnt.data;
    		$('#goodswrapper').html('');
    		var tpl=goodscontent.innerHTML;
    		laytpl(tpl).render(goodso,function(html){
    			$('#goodswrapper').append(html);
    		})
    	}
    })

    $('#goodswrapper').on('tap','li',function(){
    	open('about.html?id='+$(this).data('id'),"_self")
    })

		
</script>
</html>